package com.roncoo.controller;



import com.roncoo.entity.ReturnData;
import com.roncoo.entity.User;
import com.roncoo.service.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wdf
 * @since 2021-03-31
 */
@Controller
@RequestMapping("/user")
public class UserController {

    @Resource
    private UserService userService;
    /**
     * 注册用户
     */
    @PostMapping("addData")
    @ResponseBody
    public int adddata(User user){
        int u=userService.addData(user);
        return u;
    }
    /**
     * 验证登录
     */
    @PostMapping("findUser")
    @ResponseBody
    public ReturnData findUser(User user) throws Exception {
        return userService.findUser(user);
    }
}

